package test;


import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.Lifecycle;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.DependsOn;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.context.ContextLoaderListener;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
public class Entity implements InitializingBean , Lifecycle {
    public static String s = "1";

    String sd;
    Entity1 entity1;

    public Entity(Entity1 entity1) {
        System.out.println(entity1 + "------");
        this.entity1 = entity1;
    }

    public Entity1 getEntity1() {
        return entity1;
    }

    public void setEntity1(Entity1 entity1) {
        this.entity1 = entity1;
    }

    public Entity() {
    }

    private String name;

//    public Entity() {
//        System.out.println("entity---");
//    }

    @PostConstruct
    public void de() {
        System.out.println(3333);
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println(entity1 + "222");
    }

    @Override
    public void start() {
        System.out.println("xxxxx");
    }

    @Override
    public void stop() {

    }

    @Override
    public boolean isRunning() {
        return false;
    }
}
